<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>图片上传</title>
</head>
<body>
<h2>图片上传</h2>
<form action="/upload" method="post" enctype="multipart/form-data">
    <input type="file" name="file" accept="image/*">
    <button type="submit">Upload</button>
</form>

<br>

<div th:if="${message}" th:text="${message}" style="color: green;"></div>
<h3>图片链接地址：</h3>
<h4 th:text="${fileUrl}"></h4>
<div th:if="${fileUrl}">
    <img th:src="${fileUrl}" alt="Uploaded Image" style="max-width: 300px;">
</div>
</body>
</html>
